home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / intuisup.lha / Intuisup / Library / BenchmarkModula / Test.mod < prev    next >
Text File  |  1992-08-21  |  38KB  |  1,000 lines

  1. MODULE Test;
  2.  
  3. (*
  4.                      IntuiSup library DEMO
  5.  
  6.               Para usar con Modula-2 Software Construction Set                
  7.    -----------------------------------------------------------------------
  8.  
  9.     por:   Mauricio Hunt R.
  10.                Apt 856 - 2150, Moravia,
  11.                San Jose, Costa Rica
  12.                Central America
  13.  
  14.    -----------------------------------------------------------------------
  15.  
  16.         Intuisup library por:
  17.  
  18.     Torsten Jürgeleit
  19.     Am Sandberg 4
  20.     W-5270 Gummersbach
  21.     Germany
  22.  
  23.    Gracias Torsten !
  24. *)
  25.  
  26. FROM SYSTEM            IMPORT ADR, BYTE, ADDRESS, TSIZE;
  27. FROM Intuition         IMPORT WindowPtr, NewWindow, IDCMPFlags, IDCMPFlagsSet,
  28.                           WindowFlags, WindowFlagsSet, WBenchScreen,
  29.                           SmartRefresh, Image, CloseWindow, IntuiMessagePtr,
  30.                           MENUNUM, ITEMNUM, SUBNUM, MenuNull, NoMenu, NoItem,
  31.                           NoSub, MenuItemPtr, GadgetPtr;
  32. FROM Libraries         IMPORT OpenLibrary, CloseLibrary;
  33. FROM Rasters           IMPORT RastPortPtr;
  34. FROM Ports             IMPORT MsgPortPtr, WaitPort;
  35. FROM Text              IMPORT TextAttr, NormalFontStyle, FontFlags,
  36.                           FontFlagsSet;
  37. FROM Memory            IMPORT MemReqSet, MemChip, MemPublic, MemClear,AllocMem,
  38.                           FreeMem;
  39. FROM Lists             IMPORT ListPtr, List, NewList, AddTail, RemHead;
  40. FROM Nodes             IMPORT NodePtr, Node;
  41. FROM Preferences       IMPORT TopazEighty, TopazSixty;
  42. FROM FormatString      IMPORT FormatArg;
  43. FROM CPrintBuffer      IMPORT sprintf;
  44. FROM IntuiSupInterface IMPORT InitIntuiSupLib, CloseIntuiSupLib, IntuiSupBase,
  45.                           IntuiSupName, IntuiSupVersion,
  46.  
  47.                           GadgetData,
  48.                           GadgetIDCMPFlagsAll, GadgetDataFlagDisabled,
  49.                           GadgetDataFlagHotKey, GadgetDataFlagTextColor2,
  50.                           GadgetDataFlagButtonToggle, 
  51.                           GadgetDataFlagButtonImage, GadgetDataFlagNoBorder,
  52.                           GadgetDataFlagTextRight, GadgetDataFlagTextLeft,
  53.                           GadgetDataFlagInputAutoActive,
  54.                           GadgetDataFlagOrientationVert,
  55.                           GadgetDataFlagMovePointer,
  56.                           GadgetDataFlagListViewShowSelected,
  57.                           GadgetDataFlagTextBelow, GadgetDataFlagTextAbove,
  58.  
  59.                           GadgetDataTypeButton,
  60.                           GadgetDataTypeCheck,GadgetDataTypeMx,
  61.                           GadgetDataTypeString, GadgetDataTypeInteger,
  62.                           GadgetDataTypeSlider, GadgetDataTypeScroller,
  63.                           GadgetDataTypeCycle, GadgetDataTypeCount,
  64.                           GadgetDataTypeListView, GadgetDataTypePalette,
  65.  
  66.                           RenderInfoFlagInnerWindow, RenderInfoFlagBackFill,
  67.                           OpenWindowFlagCenterWindow,
  68.                           IntuiSupDataEnd,
  69.  
  70.                           BorderData,
  71.                           BorderDataTypeBox2Out,
  72.  
  73.                           MenuData,
  74.                           MenuDataTypeTitle, MenuDataTypeItem, 
  75.                           MenuDataTypeSubItem,
  76.  
  77.                           MenuDataFlagAtributte, MenuDataFlagSelected,
  78.                           MenuDataFlagHighBox, MenuDataFlagEmptyLine,
  79.  
  80.                           TextData,
  81.                           TextDataTypeText,TextDataFlagCenter,
  82.                           TextDataFlagBold, TextDataFlagItalic,
  83.                           TextDataFlagUnderLined,
  84.                           TextDataFlagColor2,UseCurrentValue,
  85.  
  86.                           AutoReqFlagBackFill, AutoReqFlagTextCenter,
  87.                           AutoReqFlagTextColor2, AutoReqFlagHotKey,
  88.                           AutoReqFlagMovePointerNeg,
  89.  
  90.                           RequesterData,
  91.                           ReqDataFlagBackFill, 
  92.                           ReqDataFlagInnerWindow,
  93.  
  94.                           IGetRenderInfo, IFreeRenderInfo, IOpenWindow,
  95.                           ICreateGadgets, IFreeGadgets, ICreateMenu,
  96.                           IFreeMenu, IDisplayGadgets, IAttachMenu, ISupID,
  97.                           IRemoveMenu, IRemoveGadgets, IGetMsg, IReplyMsg,
  98.                           IClearRenderWindow, IPrintText,
  99.                           IAutoRequest, IDisplayRequester, IRemoveRequester,
  100.                           ISetGadgetAttributes, IMenuItemAddress;
  101.  
  102. CONST
  103.   WindowWidth = 600;
  104.   WindowHeight = 200;
  105.   WindowTitle = " Library Test ";
  106.   WindowIDCMPflags = IDCMPFlagsSet{Closewindow, MenuPick}+GadgetIDCMPFlagsAll;
  107.   Windowflags = WindowFlagsSet{WindowClose, WindowDrag, WindowDepth,
  108.                 Activate,NoCareRefresh}+SmartRefresh;
  109.  
  110.   RenderInfoFlags = RenderInfoFlagInnerWindow + RenderInfoFlagBackFill;
  111.   OpenWindowFlags = OpenWindowFlagCenterWindow;
  112.  
  113.   MessageLeftEdge = 0;
  114.   MessageTopEdge  = 179; (* (WindowHeight - MessageHeight - 10) *)
  115.   MessageWidth    = WindowWidth;
  116.   MessageHeight   = 8;
  117.   MessageText1    = "Gadget %d text %s";
  118.   MessageText2    = "Gadget %d value %ld";
  119.   MessageText3    = " Menu no. %d menu item no. %d sub item no. %d selected";
  120.  
  121. VAR
  122.   testnewwindow:NewWindow;
  123.   topaz60attr, topaz80attr: TextAttr;
  124.   testgadgetdata:ARRAY [0..14] OF GadgetData;
  125.  
  126.   test2textdata : ARRAY [0..4] OF TextData;
  127.   test2borderdata : ARRAY [0..1] OF BorderData;
  128.   test2gadgetdata : ARRAY [0..1] OF GadgetData;
  129.   test2requesterdata:RequesterData;
  130.  
  131.   image1data,image2data:POINTER TO ARRAY [0..15] OF CARDINAL;
  132.   image1,image2:Image;
  133.   mxarray: ARRAY [0..3] OF ADDRESS;
  134.   textarray : ARRAY [0..8] OF ADDRESS;
  135.   testlist:List;
  136.   testmenudata:ARRAY [0..17] OF MenuData;
  137.  
  138. CONST
  139.   TestGadgetButton        = 0;
  140.   TestGadgetButtonImage   = 1;
  141.   TestGadgetCheck         = 2;
  142.   TestGadgetMx            = 3;
  143.   TestGadgetString        = 4;
  144.   TestGadgetInteger       = 5;
  145.   TestGadgetSliderHoriz   = 6;
  146.   TestGadgetSliderVert    = 7;
  147.   TestGadgetScrollerHoriz = 8;
  148.   TestGadgetScrollerVert  = 9;
  149.   TestGadgetCycle         = 10;
  150.   TestGadgetCount         = 11;
  151.   TestGadgetListView      = 12;
  152.   TestGadgetPalette       = 13;
  153.  
  154.   TestGadget1Type     = GadgetDataTypeButton;
  155.   TestGadget1Flags    = GadgetDataFlagHotKey+GadgetDataFlagTextColor2;
  156.   TestGadget1LeftEdge = 20;
  157.   TestGadget1TopEdge  = 10;
  158.   TestGadget1Width    = ((6 + 2) * 10);
  159.   TestGadget1Height   = 19;
  160.   TestGadget1Text     = "_Button";
  161.  
  162.   TestGadget2Type     = GadgetDataTypeButton;
  163.   TestGadget2Flags    = GadgetDataFlagButtonToggle+GadgetDataFlagButtonImage+
  164.                       GadgetDataFlagNoBorder+GadgetDataFlagHotKey+
  165.                       GadgetDataFlagTextRight+GadgetDataFlagTextColor2;
  166.   TestGadget2LeftEdge = 120;
  167.   TestGadget2TopEdge  = 15;
  168.   TestGadget2Width    = 16;
  169.   TestGadget2Height   = 8;
  170.   TestGadget2Text     = "_Image";
  171.  
  172.   TestGadget3Type       = GadgetDataTypeCheck;
  173.   TestGadget3Flags      = GadgetDataFlagHotKey + GadgetDataFlagTextRight;
  174.   TestGadget3LeftEdge   = 20;
  175.   TestGadget3TopEdge    = 35;
  176.   TestGadget3Width      = 0;
  177.   TestGadget3Height     = 0;
  178.   TestGadget3Text       = "_Check Gadget";
  179.   TestGadget3CheckState = 1;
  180.  
  181.   TestGadget4Type     = GadgetDataTypeMx;
  182.   TestGadget4Flags    = GadgetDataFlagHotKey+GadgetDataFlagTextLeft+
  183.                         GadgetDataFlagTextColor2;
  184.   TestGadget4LeftEdge = 20;
  185.   TestGadget4TopEdge  = 65;
  186.   TestGadget4Width    = 0;
  187.   TestGadget4Height   = 0;
  188.   TestGadget4Text     = "Mutual E_xclude gadget";
  189.   TestGadget4Spacing  = 2;
  190.   TestGadget4Active   = 1;
  191.  
  192.   TestGadget5Type         = GadgetDataTypeString;
  193.   TestGadget5Flags        = GadgetDataFlagHotKey+GadgetDataFlagInputAutoActive+
  194.                             GadgetDataFlagTextRight;
  195.   TestGadget5LeftEdge     = 20;
  196.   TestGadget5TopEdge      = 112;
  197.   TestGadget5Width        = 68;
  198.   TestGadget5Height       = 0;
  199.   TestGadget5Text         = "_String Gadget";
  200.   TestGadget5InputLen     = 10;
  201.   TestGadget5AutoActive   = (5D*65536D)+5D;
  202.   TestGadget5InputDefault = "Test";
  203.  
  204.   TestGadget6Type         = GadgetDataTypeInteger;
  205.   TestGadget6Flags        = GadgetDataFlagHotKey+
  206.                             GadgetDataFlagInputAutoActive+
  207.                             GadgetDataFlagTextLeft+GadgetDataFlagTextColor2;
  208.   TestGadget6LeftEdge     = (20 + 14 * 10 + 8);
  209.   TestGadget6TopEdge      = 130;
  210.   TestGadget6Width        = 68;
  211.   TestGadget6Height       = 0;
  212.   TestGadget6Text         = "I_nteger gadget";
  213.   TestGadget6InputLen     = 10;
  214.   TestGadget6AutoActive   = (4D*65536D)+4D;
  215.  
  216.   TestGadget7Type     = GadgetDataTypeSlider;
  217.   TestGadget7Flags    = GadgetDataFlagHotKey + GadgetDataFlagTextRight;
  218.   TestGadget7LeftEdge = 20;
  219.   TestGadget7TopEdge  = 150;
  220.   TestGadget7Width    = 100;
  221.   TestGadget7Height   = 9;
  222.   TestGadget7Text     = "S_lider gadget";
  223.   TestGadget7Min      = -10;
  224.   TestGadget7Max      = 10;
  225.   TestGadget7Level    = 0;
  226.  
  227.   TestGadget8Type     = GadgetDataTypeSlider;
  228.   TestGadget8Flags    = GadgetDataFlagHotKey+GadgetDataFlagOrientationVert+
  229.                         GadgetDataFlagTextBelow;
  230.   TestGadget8LeftEdge = 390;
  231.   TestGadget8TopEdge  = 10;
  232.   TestGadget8Width    = 18;
  233.   TestGadget8Height   = 50;
  234.   TestGadget8Text     = "Sli_der gadget";
  235.   TestGadget8Min      = -10;
  236.   TestGadget8Max      = 10;
  237.   TestGadget8Level    = 0;
  238.  
  239.   TestGadget9Type     = GadgetDataTypeScroller;
  240.   TestGadget9Flags    = GadgetDataFlagHotKey+GadgetDataFlagTextLeft+
  241.                         GadgetDataFlagTextColor2;
  242.   TestGadget9LeftEdge = (20 + 15 * 10 + 8);
  243.   TestGadget9TopEdge  =  165;
  244.   TestGadget9Width    = 100;
  245.   TestGadget9Height   = 0;
  246.   TestGadget9Text     = "Scr_oller gadget";
  247.   TestGadget9Visible  = 4D;
  248.   TestGadget9Total    = 20D;
  249.   TestGadget9Top      = 10D;
  250.  
  251.   TestGadget10Type     = GadgetDataTypeScroller;
  252.   TestGadget10Flags    = GadgetDataFlagHotKey+GadgetDataFlagOrientationVert+
  253.                          GadgetDataFlagTextAbove;
  254.   TestGadget10LeftEdge = 490;
  255.   TestGadget10TopEdge  =  20;
  256.   TestGadget10Width    = 0;
  257.   TestGadget10Height   = 50;
  258.   TestGadget10Text     = "Sc_roller gadget";
  259.   TestGadget10Visible  = 4;
  260.   TestGadget10Total    = 20;
  261.   TestGadget10Top      = 10;
  262.  
  263.   TestGadget11Type     = GadgetDataTypeCycle;
  264.   TestGadget11Flags    = GadgetDataFlagHotKey+GadgetDataFlagTextRight+
  265.                          GadgetDataFlagTextColor2;
  266.   TestGadget11LeftEdge = 265;
  267.   TestGadget11TopEdge  = 80;
  268.   TestGadget11Width    = 160;
  269.   TestGadget11Height   = 19;
  270.   TestGadget11Text     = "C_ycle gadget";
  271.   TestGadget11Active   = 2;
  272.  
  273.   TestGadget12Type     = GadgetDataTypeCount;
  274.   TestGadget12Flags    = GadgetDataFlagHotKey+GadgetDataFlagTextRight;
  275.   TestGadget12LeftEdge = 325;
  276.   TestGadget12TopEdge  = 110;
  277.   TestGadget12Width    = 80;
  278.   TestGadget12Height   = 12;
  279.   TestGadget12Text     = "Co_unt gadget";
  280.   TestGadget12Min      = 100;
  281.   TestGadget12Max      = 1000;
  282.   TestGadget12Value    = 600;
  283.  
  284.   TestGadget13Type     = GadgetDataTypeListView;
  285.   TestGadget13Flags    = GadgetDataFlagHotKey+GadgetDataFlagTextColor2
  286.                          +GadgetDataFlagListViewShowSelected;
  287.   TestGadget13LeftEdge = 370;
  288.   TestGadget13TopEdge  = 144;
  289.   TestGadget13Width    = 104;
  290.   TestGadget13Height   = 35;
  291.   TestGadget13Text     = "List _view gadget";
  292.   TestGadget13Spacing  = 0;
  293.   TestGadget13Top      = 1;
  294.  
  295.   TestGadget14Type        = GadgetDataTypePalette;
  296.   TestGadget14Flags       = GadgetDataFlagHotKey + GadgetDataFlagTextColor2;
  297.   TestGadget14LeftEdge    = 220;
  298.   TestGadget14TopEdge     = 23;
  299.   TestGadget14Width       = 150;
  300.   TestGadget14Height      = 25;
  301.   TestGadget14Text        = "_Palette gadget";
  302.   TestGadget14Depth       = 2;
  303.   TestGadget14ColorOffset = 0;
  304.   TestGadget14ActiveColor = 0;
  305.  
  306.   Test1AutoReqTitle    = " Auto Request ";
  307.   Test1AutoReqBodyText = "Test line 1\\n\\nTest line 2\\nTest line 3\\n\\nTest line 4";
  308.   Test1AutoReqPosText  = "_Positive";
  309.   Test1AutoReqNegText  = "_Negative";
  310.   Test1AutoReqFlags    = AutoReqFlagBackFill+AutoReqFlagTextCenter+
  311.                          AutoReqFlagTextColor2+AutoReqFlagHotKey+
  312.                          AutoReqFlagMovePointerNeg;
  313.  
  314.   Test2ReqWidth  = 200;
  315.   Test2ReqHeight = 100;
  316.   Test2ReqFlags  = ReqDataFlagBackFill+
  317.                    ReqDataFlagInnerWindow;
  318.   Test2ReqTitle  = " Requester ";
  319.  
  320.   Test2Text1Type     = TextDataTypeText;
  321.   Test2Text1Flags    = TextDataFlagCenter+TextDataFlagBold;
  322.   Test2Text1LeftEdge = 0;
  323.   Test2Text1TopEdge  = 20;
  324.   Test2Text1Text     = "Text Line 1";
  325.  
  326.   Test2Text2Type     = TextDataTypeText;
  327.   Test2Text2Flags    = TextDataFlagCenter+TextDataFlagItalic+
  328.                        TextDataFlagColor2;
  329.   Test2Text2LeftEdge = 0;
  330.   Test2Text2TopEdge  = Test2Text1TopEdge + 10;
  331.   Test2Text2Text     = "Text Line 2";
  332.  
  333.   Test2Text3Type     = TextDataTypeText;
  334.   Test2Text3Flags    = TextDataFlagCenter+TextDataFlagUnderLined;
  335.   Test2Text3LeftEdge = 0;
  336.   Test2Text3TopEdge  = Test2Text2TopEdge + 10;
  337.   Test2Text3Text     = "Text Line 3";
  338.  
  339.   Test2Border1Type     = BorderDataTypeBox2Out;
  340.   Test2Border1LeftEdge = 20;
  341.   Test2Border1TopEdge  = 10;
  342.   Test2Border1Width    = Test2ReqWidth-2 * Test2Border1LeftEdge;
  343.   Test2Border1Height   = Test2ReqHeight - (3 * Test2Border1TopEdge+19);
  344.                          (*Test2Gadget1Height*)
  345.  
  346.   Test2GadgetContinue = 0;
  347.  
  348.   Test2Gadget1Type     = GadgetDataTypeButton;
  349.   Test2Gadget1Flags    = GadgetDataFlagHotKey+GadgetDataFlagMovePointer;
  350.   Test2Gadget1Width    = ((8 + 2) * 10);
  351.   Test2Gadget1Height   = 19;
  352.   Test2Gadget1LeftEdge = (Test2ReqWidth - Test2Gadget1Width) DIV 2;
  353.   Test2Gadget1TopEdge  = Test2ReqHeight - (Test2Gadget1Height + 10);
  354.   Test2Gadget1Text     = "_Continue";
  355.  
  356. PROCEDURE InitData();
  357.  
  358. VAR
  359.   defvalue : LONGCARD;
  360.  
  361. BEGIN
  362.   testnewwindow.LeftEdge := 0;
  363.   testnewwindow.TopEdge := 0;
  364.   testnewwindow.Width := WindowWidth;
  365.   testnewwindow.Height := WindowHeight;
  366.   testnewwindow.DetailPen := BYTE(0);
  367.   testnewwindow.BlockPen := BYTE(1);
  368.   testnewwindow.IDCMPFlags := WindowIDCMPflags;
  369.   testnewwindow.Flags := Windowflags;
  370.   testnewwindow.FirstGadget := NIL;
  371.   testnewwindow.CheckMark := NIL;
  372.   testnewwindow.Title := ADR(WindowTitle);
  373.   testnewwindow.Screen := NIL;
  374.   testnewwindow.BitMap := NIL;
  375.   testnewwindow.MinWidth := 0;
  376.   testnewwindow.MinHeight := 0;
  377.   testnewwindow.MaxWidth := 0;
  378.   testnewwindow.MaxHeight := 0;
  379.   testnewwindow.Type := WBenchScreen;
  380.  
  381.   topaz60attr.taName := ADR("topaz.font");
  382.   topaz60attr.taYSize := TopazSixty;
  383.   topaz60attr.taStyle := NormalFontStyle;
  384.   topaz60attr.taFlags := FontFlagsSet{RomFont};
  385.  
  386.   topaz80attr.taName := ADR("topaz.font");
  387.   topaz80attr.taYSize := TopazEighty;
  388.   topaz80attr.taStyle := NormalFontStyle;
  389.   topaz80attr.taFlags := FontFlagsSet{RomFont};
  390.  
  391.   image1data := AllocMem(32,MemReqSet{MemChip});
  392.  
  393.   image1data^[0] := 0FFFFH; image1data^[1] := 08000H; image1data^[2] := 0BFF0H;
  394.   image1data^[3] := 0A00CH; image1data^[4] := 0A00CH; image1data^[5] := 0BFF0H;
  395.   image1data^[6] := 08000H; image1data^[7] := 08000H; image1data^[8] := 00000H;
  396.   image1data^[9] := 00001H; image1data^[10] := 00005H; image1data^[11] := 01FF1H;
  397.   image1data^[12] := 01FF1H; image1data^[13] := 00005H; image1data^[14] := 00001H;
  398.   image1data^[15] := 07FFFH;
  399.  
  400.   image1.LeftEdge := 0;
  401.   image1.TopEdge := 0;
  402.   image1.Width := 16;
  403.   image1.Height := 8;
  404.   image1.Depth := 2;
  405.   image1.ImageData := image1data;
  406.   image1.PlanePick := BYTE(3);
  407.   image1.PlaneOnOff := BYTE(0);
  408.   image1.NextImage := NIL;
  409.  
  410.   image2data := AllocMem(32,MemReqSet{MemChip});
  411.  
  412.   image2data^[0] := 00000H; image2data^[1] := 0000FH; image2data^[2] := 03FFFH;
  413.   image2data^[3] := 023FDH; image2data^[4] := 03FCDH; image2data^[5] := 07FF1H;
  414.   image2data^[6] := 07001H; image2data^[7] := 07FFFH; image2data^[8] := 0FFFFH;
  415.   image2data^[9] := 0800EH; image2data^[10] := 0807EH; image2data^[11] := 09FF8H;
  416.   image2data^[12] := 09FF0H; image2data^[13] := 0FE04H; image2data^[14] := 0F000H;
  417.   image2data^[15] := 08000H;
  418.  
  419.   image2.LeftEdge := 0;
  420.   image2.TopEdge := 0;
  421.   image2.Width := 16;
  422.   image2.Height := 8;
  423.   image2.Depth := 2;
  424.   image2.ImageData := image2data;
  425.   image2.PlanePick := BYTE(3);
  426.   image2.PlaneOnOff := BYTE(0);
  427.   image2.NextImage := NIL;
  428.  
  429.   mxarray[0] := ADR("Fast File System");
  430.   mxarray[1] := ADR("Old File System");
  431.   mxarray[2] := ADR("Custom FileSystem");
  432.   mxarray[3] := NIL;
  433.  
  434.   textarray[0] := ADR("Amiga");
  435.   textarray[1] := ADR("Workbench");
  436.   textarray[2] := ADR("AmigaDos");
  437.   textarray[3] := ADR("Multitasking");
  438.   textarray[4] := ADR("CLI");
  439.   textarray[5] := ADR("Arexx");
  440.   textarray[6] := ADR("Tex");
  441.   textarray[7] := ADR("Unix");
  442.   textarray[8] := NIL;
  443.  
  444.   testgadgetdata[0].gdType := TestGadget1Type;
  445.   testgadgetdata[0].gdFlags := TestGadget1Flags;
  446.   testgadgetdata[0].gdLeftEdge := TestGadget1LeftEdge;
  447.   testgadgetdata[0].gdTopEdge := TestGadget1TopEdge;
  448.   testgadgetdata[0].gdWidth := TestGadget1Width;
  449.   testgadgetdata[0].gdHeight := TestGadget1Height;
  450.   testgadgetdata[0].gdText := ADR(TestGadget1Text);
  451.   testgadgetdata[0].gdTextAttr := ADR(topaz60attr);
  452.   testgadgetdata[0].gdButtonData.gdButtonSelected := 0D;
  453.   testgadgetdata[0].gdButtonData.gdButtonNormalRender := NIL;
  454.   testgadgetdata[0].gdButtonData.gdButtonSelectRender := NIL;
  455.  
  456.   testgadgetdata[1].gdType := TestGadget2Type;
  457.   testgadgetdata[1].gdFlags := TestGadget2Flags;
  458.   testgadgetdata[1].gdLeftEdge := TestGadget2LeftEdge;
  459.   testgadgetdata[1].gdTopEdge := TestGadget2TopEdge;
  460.   testgadgetdata[1].gdWidth := TestGadget2Width;
  461.   testgadgetdata[1].gdHeight := TestGadget2Height;
  462.   testgadgetdata[1].gdText := ADR(TestGadget2Text);
  463.   testgadgetdata[1].gdTextAttr := ADR(topaz60attr);
  464.   testgadgetdata[1].gdButtonData.gdButtonSelected := 0D;
  465.   testgadgetdata[1].gdButtonData.gdButtonNormalRender := ADR(image1);
  466.   testgadgetdata[1].gdButtonData.gdButtonSelectRender := ADR(image2);
  467.  
  468.   testgadgetdata[2].gdType := TestGadget3Type;
  469.   testgadgetdata[2].gdFlags := TestGadget3Flags;
  470.   testgadgetdata[2].gdLeftEdge := TestGadget3LeftEdge;
  471.   testgadgetdata[2].gdTopEdge := TestGadget3TopEdge;
  472.   testgadgetdata[2].gdWidth := TestGadget3Width;
  473.   testgadgetdata[2].gdHeight := TestGadget3Height;
  474.   testgadgetdata[2].gdText := ADR(TestGadget3Text);
  475.   testgadgetdata[2].gdTextAttr := ADR(topaz60attr);
  476.   testgadgetdata[2].gdCheckData.gdCheckSelected := TestGadget3CheckState;
  477.   testgadgetdata[2].gdCheckData.gdCheckPad1 := 0D;
  478.   testgadgetdata[2].gdCheckData.gdCheckPad2 := 0D;
  479.  
  480.   testgadgetdata[3].gdType := TestGadget4Type;
  481.   testgadgetdata[3].gdFlags := TestGadget4Flags;
  482.   testgadgetdata[3].gdLeftEdge := TestGadget4LeftEdge;
  483.   testgadgetdata[3].gdTopEdge := TestGadget4TopEdge;
  484.   testgadgetdata[3].gdWidth := TestGadget4Width;
  485.   testgadgetdata[3].gdHeight := TestGadget4Height;
  486.   testgadgetdata[3].gdText := ADR(TestGadget4Text);
  487.   testgadgetdata[3].gdTextAttr := ADR(topaz60attr);
  488.   testgadgetdata[3].gdMXData.gdMXSpacing := TestGadget4Spacing;
  489.   testgadgetdata[3].gdMXData.gdMXActiveEntry := TestGadget4Active;
  490.   testgadgetdata[3].gdMXData.gdMXTextArray := ADR(mxarray);
  491.  
  492.   testgadgetdata[4].gdType := TestGadget5Type;
  493.   testgadgetdata[4].gdFlags := TestGadget5Flags;
  494.   testgadgetdata[4].gdLeftEdge := TestGadget5LeftEdge;
  495.   testgadgetdata[4].gdTopEdge := TestGadget5TopEdge;
  496.   testgadgetdata[4].gdWidth := TestGadget5Width;
  497.   testgadgetdata[4].gdHeight := TestGadget5Height;
  498.   testgadgetdata[4].gdText := ADR(TestGadget5Text);
  499.   testgadgetdata[4].gdTextAttr := ADR(topaz60attr);
  500.   testgadgetdata[4].gdInputData.gdInputLen := TestGadget5InputLen;
  501.   testgadgetdata[4].gdInputData.gdInputActiveNext := TestGadget5AutoActive;
  502.   testgadgetdata[4].gdInputData.gdInputActiveNext := TestGadget5AutoActive;
  503.   testgadgetdata[4].gdInputData.gdInputDefault := ADR(TestGadget5InputDefault);
  504.  
  505.   testgadgetdata[5].gdType := TestGadget6Type;
  506.   testgadgetdata[5].gdFlags := TestGadget6Flags;
  507.   testgadgetdata[5].gdLeftEdge := TestGadget6LeftEdge;
  508.   testgadgetdata[5].gdTopEdge := TestGadget6TopEdge;
  509.   testgadgetdata[5].gdWidth := TestGadget6Width;
  510.   testgadgetdata[5].gdHeight := TestGadget6Height;
  511.   testgadgetdata[5].gdText := ADR(TestGadget6Text);
  512.   testgadgetdata[5].gdTextAttr := ADR(topaz60attr);
  513.   testgadgetdata[5].gdInputData.gdInputLen := TestGadget6InputLen;
  514.   testgadgetdata[5].gdInputData.gdInputActiveNext := TestGadget6AutoActive;
  515.   testgadgetdata[5].gdInputData.gdInputActiveNext := TestGadget6AutoActive;
  516.   testgadgetdata[5].gdInputData.gdInputDefault := 123D;
  517.  
  518.   testgadgetdata[6].gdType := TestGadget7Type;
  519.   testgadgetdata[6].gdFlags := TestGadget7Flags;
  520.   testgadgetdata[6].gdLeftEdge := TestGadget7LeftEdge;
  521.   testgadgetdata[6].gdTopEdge := TestGadget7TopEdge;
  522.   testgadgetdata[6].gdWidth := TestGadget7Width;
  523.   testgadgetdata[6].gdHeight := TestGadget7Height;
  524.   testgadgetdata[6].gdText := ADR(TestGadget7Text);
  525.   testgadgetdata[6].gdTextAttr := ADR(topaz60attr);
  526.   testgadgetdata[6].gdSliderData.gdSliderMin := TestGadget7Min;
  527.   testgadgetdata[6].gdSliderData.gdSliderMax := TestGadget7Max;
  528.   testgadgetdata[6].gdSliderData.gdSliderLevel := TestGadget7Level;
  529.  
  530.   testgadgetdata[7].gdType := TestGadget8Type;
  531.   testgadgetdata[7].gdFlags := TestGadget8Flags;
  532.   testgadgetdata[7].gdLeftEdge := TestGadget8LeftEdge;
  533.   testgadgetdata[7].gdTopEdge := TestGadget8TopEdge;
  534.   testgadgetdata[7].gdWidth := TestGadget8Width;
  535.   testgadgetdata[7].gdHeight := TestGadget8Height;
  536.   testgadgetdata[7].gdText := ADR(TestGadget8Text);
  537.   testgadgetdata[7].gdTextAttr := ADR(topaz60attr);
  538.   testgadgetdata[7].gdSliderData.gdSliderMin := TestGadget8Min;
  539.   testgadgetdata[7].gdSliderData.gdSliderMax := TestGadget8Max;
  540.   testgadgetdata[7].gdSliderData.gdSliderLevel := TestGadget8Level;
  541.  
  542.   testgadgetdata[8].gdType := TestGadget9Type;
  543.   testgadgetdata[8].gdFlags := TestGadget9Flags;
  544.   testgadgetdata[8].gdLeftEdge := TestGadget9LeftEdge;
  545.   testgadgetdata[8].gdTopEdge := TestGadget9TopEdge;
  546.   testgadgetdata[8].gdWidth := TestGadget9Width;
  547.   testgadgetdata[8].gdHeight := TestGadget9Height;
  548.   testgadgetdata[8].gdText := ADR(TestGadget9Text);
  549.   testgadgetdata[8].gdTextAttr := ADR(topaz60attr);
  550.   testgadgetdata[8].gdScrollerData.gdScrollerVisible := TestGadget9Visible;
  551.   testgadgetdata[8].gdScrollerData.gdScrollerTotal := TestGadget9Total;
  552.   testgadgetdata[8].gdScrollerData.gdScrollerTop := TestGadget9Top;
  553.  
  554.   testgadgetdata[9].gdType := TestGadget10Type;
  555.   testgadgetdata[9].gdFlags := TestGadget10Flags;
  556.   testgadgetdata[9].gdLeftEdge := TestGadget10LeftEdge;
  557.   testgadgetdata[9].gdTopEdge := TestGadget10TopEdge;
  558.   testgadgetdata[9].gdWidth := TestGadget10Width;
  559.   testgadgetdata[9].gdHeight := TestGadget10Height;
  560.   testgadgetdata[9].gdText := ADR(TestGadget10Text);
  561.   testgadgetdata[9].gdTextAttr := ADR(topaz60attr);
  562.   testgadgetdata[9].gdScrollerData.gdScrollerVisible := TestGadget10Visible;
  563.   testgadgetdata[9].gdScrollerData.gdScrollerTotal := TestGadget10Total;
  564.   testgadgetdata[9].gdScrollerData.gdScrollerTop := TestGadget10Top;
  565.  
  566.   testgadgetdata[10].gdType := TestGadget11Type;
  567.   testgadgetdata[10].gdFlags := TestGadget11Flags;
  568.   testgadgetdata[10].gdLeftEdge := TestGadget11LeftEdge;
  569.   testgadgetdata[10].gdTopEdge := TestGadget11TopEdge;
  570.   testgadgetdata[10].gdWidth := TestGadget11Width;
  571.   testgadgetdata[10].gdHeight := TestGadget11Height;
  572.   testgadgetdata[10].gdText := ADR(TestGadget11Text);
  573.   testgadgetdata[10].gdTextAttr := ADR(topaz60attr);
  574.   testgadgetdata[10].gdCycleData.gdCycleSpacing := 0;
  575.   testgadgetdata[10].gdCycleData.gdCycleActive := TestGadget11Active;
  576.   testgadgetdata[10].gdCycleData.gdCycleTextArray := ADR(textarray);
  577.  
  578.   testgadgetdata[11].gdType := TestGadget12Type;
  579.   testgadgetdata[11].gdFlags := TestGadget12Flags;
  580.   testgadgetdata[11].gdLeftEdge := TestGadget12LeftEdge;
  581.   testgadgetdata[11].gdTopEdge := TestGadget12TopEdge;
  582.   testgadgetdata[11].gdWidth := TestGadget12Width;
  583.   testgadgetdata[11].gdHeight := TestGadget12Height;
  584.   testgadgetdata[11].gdText := ADR(TestGadget12Text);
  585.   testgadgetdata[11].gdTextAttr := ADR(topaz80attr);
  586.   testgadgetdata[11].gdCountData.gdCountMin := TestGadget12Min;
  587.   testgadgetdata[11].gdCountData.gdCountMax := TestGadget12Max;
  588.   testgadgetdata[11].gdCountData.gdCountValue := TestGadget12Value;
  589.  
  590.   testgadgetdata[12].gdType := TestGadget13Type;
  591.   testgadgetdata[12].gdFlags := TestGadget13Flags;
  592.   testgadgetdata[12].gdLeftEdge := TestGadget13LeftEdge;
  593.   testgadgetdata[12].gdTopEdge := TestGadget13TopEdge;
  594.   testgadgetdata[12].gdWidth := TestGadget13Width;
  595.   testgadgetdata[12].gdHeight := TestGadget13Height;
  596.   testgadgetdata[12].gdText := ADR(TestGadget13Text);
  597.   testgadgetdata[12].gdTextAttr := ADR(topaz60attr);
  598.   testgadgetdata[12].gdListViewData.gdListViewSpacing := TestGadget13Spacing;
  599.   testgadgetdata[12].gdListViewData.gdListViewTop := TestGadget13Top;
  600.   testgadgetdata[12].gdListViewData.gdListViewList := ADR(testlist);
  601.  
  602.   testgadgetdata[13].gdType := TestGadget14Type;
  603.   testgadgetdata[13].gdFlags := TestGadget14Flags;
  604.   testgadgetdata[13].gdLeftEdge := TestGadget14LeftEdge;
  605.   testgadgetdata[13].gdTopEdge := TestGadget14TopEdge;
  606.   testgadgetdata[13].gdWidth := TestGadget14Width;
  607.   testgadgetdata[13].gdHeight := TestGadget14Height;
  608.   testgadgetdata[13].gdText := ADR(TestGadget14Text);
  609.   testgadgetdata[13].gdTextAttr := ADR(topaz60attr);
  610.   testgadgetdata[13].gdPaletteData.gdPaletteDepth := TestGadget14Depth;
  611.   testgadgetdata[13].gdPaletteData.gdPaletteColorOffset := TestGadget14ColorOffset;
  612.   testgadgetdata[13].gdPaletteData.gdPaletteActiveColor := TestGadget14ActiveColor;
  613.  
  614.   testgadgetdata[14].gdType := IntuiSupDataEnd;
  615.  
  616.   test2textdata[0].tdType := Test2Text1Type;
  617.   test2textdata[0].tdFlags :=  Test2Text1Flags;
  618.   test2textdata[0].tdLeftEdge := Test2Text1LeftEdge;
  619.   test2textdata[0].tdTopEdge := Test2Text1TopEdge;
  620.   test2textdata[0].tdText :=  ADR(Test2Text1Text);
  621.   test2textdata[0].tdTextAttr := ADR(topaz80attr);
  622.  
  623.   test2textdata[1].tdType :=  Test2Text2Type;
  624.   test2textdata[1].tdFlags :=  Test2Text2Flags;
  625.   test2textdata[1].tdLeftEdge := Test2Text2LeftEdge;
  626.   test2textdata[1].tdTopEdge := Test2Text2TopEdge;
  627.   test2textdata[1].tdText := ADR(Test2Text2Text);
  628.   test2textdata[1].tdTextAttr := ADR(topaz80attr);
  629.  
  630.   test2textdata[2].tdType :=  Test2Text3Type;
  631.   test2textdata[2].tdFlags :=  Test2Text3Flags;
  632.   test2textdata[2].tdLeftEdge :=  Test2Text3LeftEdge;
  633.   test2textdata[2].tdTopEdge :=  Test2Text3TopEdge;
  634.   test2textdata[2].tdText := ADR(Test2Text3Text);
  635.   test2textdata[2].tdTextAttr := ADR(topaz80attr);
  636.  
  637.   test2textdata[3].tdType :=  IntuiSupDataEnd;
  638.  
  639.   test2borderdata[0].bdType := Test2Border1Type;
  640.   test2borderdata[0].bdLeftEdge :=  Test2Border1LeftEdge;
  641.   test2borderdata[0].bdTopEdge :=  Test2Border1TopEdge;
  642.   test2borderdata[0].bdWidth :=  Test2Border1Width;
  643.   test2borderdata[0].bdHeight :=  Test2Border1Height;
  644.  
  645.   test2borderdata[1].bdType := IntuiSupDataEnd;
  646.  
  647.   test2gadgetdata[0].gdType := Test2Gadget1Type;
  648.   test2gadgetdata[0].gdFlags :=  Test2Gadget1Flags;
  649.   test2gadgetdata[0].gdLeftEdge := Test2Gadget1LeftEdge;
  650.   test2gadgetdata[0].gdTopEdge := Test2Gadget1TopEdge;
  651.   test2gadgetdata[0].gdWidth := Test2Gadget1Width;
  652.   test2gadgetdata[0].gdHeight := Test2Gadget1Height;
  653.   test2gadgetdata[0].gdText := ADR(Test2Gadget1Text);
  654.   test2gadgetdata[0].gdTextAttr := ADR(topaz80attr);
  655.  
  656.   test2gadgetdata[1].gdType := IntuiSupDataEnd;
  657.  
  658.   test2requesterdata.rdLeftEdge:= 0;
  659.   test2requesterdata.rdTopEdge := 0;
  660.   test2requesterdata.rdWidth   := Test2ReqWidth;
  661.   test2requesterdata.rdHeight  := Test2ReqHeight;
  662.   test2requesterdata.rdFlags   := Test2ReqFlags;
  663.   test2requesterdata.rdTitle   := ADR(Test2ReqTitle);
  664.   test2requesterdata.rdTexts   := ADR(test2textdata);
  665.   test2requesterdata.rdBorders := ADR(test2borderdata);
  666.   test2requesterdata.rdGadgets := ADR(test2gadgetdata);
  667.  
  668.   testmenudata[0].mdType := MenuDataTypeTitle;
  669.   testmenudata[0].mdFlags := 0;
  670.   testmenudata[0].mdName := ADR("Menu 0");
  671.   testmenudata[0].mdCommandKey := NIL;
  672.   testmenudata[0].mdMutualExclude := 0D;
  673.  
  674.   testmenudata[1].mdType := MenuDataTypeItem;
  675.   testmenudata[1].mdFlags := MenuDataFlagAtributte+MenuDataFlagSelected;
  676.   testmenudata[1].mdName := ADR("Item 0.0");
  677.   testmenudata[1].mdCommandKey := ADR("0");
  678.   testmenudata[1].mdMutualExclude := 0FFFFFFFEH;
  679.  
  680.   testmenudata[2].mdType := MenuDataTypeItem;
  681.   testmenudata[2].mdFlags := MenuDataFlagAtributte;
  682.   testmenudata[2].mdName := ADR("Item 0.1");
  683.   testmenudata[2].mdCommandKey := ADR("1");
  684.   testmenudata[2].mdMutualExclude := 0FFFFFFFDH;
  685.  
  686.   testmenudata[3].mdType := MenuDataTypeItem;
  687.   testmenudata[3].mdFlags := MenuDataFlagHighBox;
  688.   testmenudata[3].mdName := ADR("Item 0.2");
  689.   testmenudata[3].mdCommandKey := NIL;
  690.   testmenudata[3].mdMutualExclude := 0;
  691.  
  692.   testmenudata[4].mdType := MenuDataTypeSubItem;
  693.   testmenudata[4].mdFlags := 0;
  694.   testmenudata[4].mdName := ADR("Item 0.2.0");
  695.   testmenudata[4].mdCommandKey := ADR("A");
  696.   testmenudata[4].mdMutualExclude := 0;
  697.  
  698.   testmenudata[5].mdType := MenuDataTypeSubItem;
  699.   testmenudata[5].mdFlags := 0;
  700.   testmenudata[5].mdName := ADR("Item 0.2.1");
  701.   testmenudata[5].mdCommandKey := ADR("B");
  702.   testmenudata[5].mdMutualExclude := 0;
  703.  
  704.   testmenudata[6].mdType := MenuDataTypeItem;
  705.   testmenudata[6].mdFlags := 0;
  706.   testmenudata[6].mdName := ADR("Item 0.3");
  707.   testmenudata[6].mdCommandKey := NIL;
  708.   testmenudata[6].mdMutualExclude := 0;
  709.  
  710.   testmenudata[7].mdType := MenuDataTypeTitle;
  711.   testmenudata[7].mdFlags := 0;
  712.   testmenudata[7].mdName := ADR("Menu1");
  713.   testmenudata[7].mdCommandKey := NIL;
  714.   testmenudata[7].mdMutualExclude := 0;
  715.  
  716.   testmenudata[8].mdType := MenuDataTypeItem;
  717.   testmenudata[8].mdFlags := MenuDataFlagHighBox;
  718.   testmenudata[8].mdName := ADR("Item 1.0");
  719.   testmenudata[8].mdCommandKey := ADR("C");
  720.   testmenudata[8].mdMutualExclude := 0;
  721.  
  722.   testmenudata[9].mdType := MenuDataTypeItem;
  723.   testmenudata[9].mdFlags := MenuDataFlagEmptyLine;
  724.   testmenudata[9].mdName := ADR("Item 1.1");
  725.   testmenudata[9].mdCommandKey := ADR("D");
  726.   testmenudata[9].mdMutualExclude := 0;
  727.  
  728.   testmenudata[10].mdType := MenuDataTypeItem;
  729.   testmenudata[10].mdFlags := 0;
  730.   testmenudata[10].mdName := ADR("Item 1.2");
  731.   testmenudata[10].mdCommandKey := NIL;
  732.   testmenudata[10].mdMutualExclude := 0;
  733.  
  734.   testmenudata[11].mdType := MenuDataTypeSubItem;
  735.   testmenudata[11].mdFlags := 0;
  736.   testmenudata[11].mdName := ADR("Item 1.2.0");
  737.   testmenudata[11].mdCommandKey := ADR("E");
  738.   testmenudata[11].mdMutualExclude := 0;
  739.  
  740.   testmenudata[12].mdType := MenuDataTypeSubItem;
  741.   testmenudata[12].mdFlags := 0;
  742.   testmenudata[12].mdName := ADR("Item 1.2.1");
  743.   testmenudata[12].mdCommandKey := ADR("F");
  744.   testmenudata[12].mdMutualExclude := 0;
  745.  
  746.   testmenudata[13].mdType := MenuDataTypeItem;
  747.   testmenudata[13].mdFlags := 0;
  748.   testmenudata[13].mdName := ADR("Item 1.3");
  749.   testmenudata[13].mdCommandKey := NIL;
  750.   testmenudata[13].mdMutualExclude := 0;
  751.  
  752.   testmenudata[14].mdType := MenuDataTypeSubItem;
  753.   testmenudata[14].mdFlags := 0;
  754.   testmenudata[14].mdName := ADR("Item 1.3.0");
  755.   testmenudata[14].mdCommandKey := ADR("G");
  756.   testmenudata[14].mdMutualExclude := 0;
  757.  
  758.   testmenudata[15].mdType := MenuDataTypeItem;
  759.   testmenudata[15].mdFlags := MenuDataFlagEmptyLine;
  760.   testmenudata[15].mdName := ADR("Item 1.3.1");
  761.   testmenudata[15].mdCommandKey := ADR("H");
  762.   testmenudata[15].mdMutualExclude := 0;
  763.  
  764.   testmenudata[16].mdType := MenuDataTypeItem;
  765.   testmenudata[16].mdFlags := 0;
  766.   testmenudata[16].mdName := ADR("Item 1.4");
  767.   testmenudata[16].mdCommandKey := ADR("I");
  768.   testmenudata[16].mdMutualExclude := 0;
  769.  
  770.   testmenudata[17].mdType := IntuiSupDataEnd;
  771. END InitData;
  772.  
  773. PROCEDURE FreeData();
  774.  
  775. BEGIN
  776.   FreeMem(image1data,32);
  777.   FreeMem(image2data,32);
  778. END FreeData;
  779.  
  780. PROCEDURE freetestlist();
  781.  
  782. VAR
  783.   list:ListPtr;
  784.   node:NodePtr;
  785.   quit:BOOLEAN;
  786.  
  787. BEGIN
  788.   list := ADR(testlist);
  789.   quit := FALSE;
  790.   WHILE (~quit) DO
  791.     node := RemHead(list^);
  792.     IF (node # NIL) THEN
  793.       FreeMem(node,TSIZE(Node))
  794.     ELSE
  795.       quit := TRUE
  796.     END
  797.   END
  798. END freetestlist;
  799.  
  800. PROCEDURE buildtestlist():BOOLEAN;
  801.  
  802. VAR
  803.   list:ListPtr;
  804.   node:NodePtr;
  805.   success,break:BOOLEAN;
  806.   i:CARDINAL;
  807.  
  808. BEGIN
  809.   list := ADR(testlist);
  810.   success := TRUE;
  811.   break := FALSE;
  812.   i := 0;
  813.  
  814.   NewList(list^);
  815.   WHILE ((i < 8) & ~(break)) DO
  816.     node := AllocMem(TSIZE(Node),MemReqSet{MemPublic,MemClear});
  817.     IF (node # NIL) THEN
  818.       node^.lnName := textarray[i];
  819.       INC(i);
  820.       AddTail(list^,node^)
  821.     ELSE
  822.       freetestlist();
  823.       success := FALSE;
  824.       break := TRUE;
  825.     END
  826.   END;
  827.   RETURN success
  828. END buildtestlist;
  829.  
  830. PROCEDURE testaction(ri:ADDRESS; win:WindowPtr; gl,ml:ADDRESS);
  831.  
  832. VAR
  833.   rp:RastPortPtr;
  834.   up:MsgPortPtr;
  835.   msg2,msg1:IntuiMessagePtr;
  836.   rl,format:ADDRESS;
  837.   buffer:ARRAY [0..80] OF CHAR;
  838.   code:CARDINAL;
  839.   input:BOOLEAN;
  840.   keepon2,keepon1:BOOLEAN;
  841.   dummy:ADDRESS;
  842.   dummy2:LONGCARD;
  843.   menuitem:MenuItemPtr;
  844.   args:ARRAY[0..9] OF FormatArg;
  845.   count,count1,count2:CARDINAL;
  846.  
  847. BEGIN
  848.   rp := win^.RPort;
  849.   up := win^.UserPort;
  850.   input := TRUE;
  851.   keepon2 := TRUE;
  852.   WHILE (keepon2) DO
  853.     dummy := WaitPort(up^);
  854.     msg2 := IGetMsg(up);
  855.     IF (msg2 # NIL) THEN
  856.       code := msg2^.Code;
  857.       IF (Closewindow IN msg2^.Class) THEN
  858.         keepon2 := FALSE
  859.       ELSIF (LONGCARD(msg2^.Class) = ISupID) THEN
  860.         IF (code = TestGadgetString) THEN
  861.           format := ADR(MessageText1)
  862.         ELSE
  863.           format := ADR(MessageText2)
  864.         END;
  865.         args[0].W := code;
  866.         args[1].L := msg2^.IAddress;
  867.         count := sprintf(ADR(buffer),format,args);
  868.  
  869.         IClearRenderWindow(ri,win,MessageLeftEdge,  MessageTopEdge,
  870.           MessageLeftEdge+MessageWidth-1,
  871.           MessageTopEdge+MessageHeight-1,0);
  872.         count := IPrintText(ri,win,ADR(buffer),0,MessageTopEdge,
  873.           TextDataTypeText,TextDataFlagCenter+TextDataFlagColor2,
  874.           ADR(topaz80attr));
  875.         CASE code OF
  876.           TestGadgetCheck:
  877.              IF (msg2^.IAddress # NIL) THEN
  878.                dummy2 := ISetGadgetAttributes(gl,TestGadgetListView,
  879.                  GadgetDataFlagDisabled,0D,
  880.                  UseCurrentValue,LONGCARD(TestGadget13Top),ADR(testlist))
  881.              ELSE
  882.                dummy2 := ISetGadgetAttributes(gl,TestGadgetListView,
  883.                  GadgetDataFlagDisabled,GadgetDataFlagDisabled,
  884.                  UseCurrentValue,UseCurrentValue,NIL)
  885.              END |
  886.           TestGadgetButton:
  887.              IF (~input) THEN
  888.                dummy2 := ISetGadgetAttributes(gl,TestGadgetInteger,
  889.                  GadgetDataFlagDisabled,0D,
  890.                  UseCurrentValue,UseCurrentValue,UseCurrentValue);
  891.                input := TRUE
  892.              ELSE
  893.                dummy2 := ISetGadgetAttributes(gl,TestGadgetInteger,
  894.                  GadgetDataFlagDisabled,GadgetDataFlagDisabled,
  895.                  UseCurrentValue,UseCurrentValue,UseCurrentValue);
  896.                input := FALSE
  897.              END |
  898.           TestGadgetButtonImage:
  899.              IF (msg2^.IAddress # NIL) THEN
  900.                input := IAutoRequest(win,ADR(Test1AutoReqTitle),
  901.                  ADR(Test1AutoReqBodyText),
  902.                  ADR(Test1AutoReqPosText), ADR(Test1AutoReqNegText),
  903.                  IDCMPFlagsSet{},IDCMPFlagsSet{},
  904.                  Test1AutoReqFlags, NIL)
  905.              ELSE
  906.                rl := IDisplayRequester(win,ADR(test2requesterdata),NIL);
  907.                IF (rl # NIL) THEN
  908.                  keepon1 := TRUE;
  909.                  WHILE (keepon1) DO
  910.                    dummy := WaitPort(up^);
  911.                    msg1 := IGetMsg(up);
  912.                    IF (msg1 # NIL) THEN
  913.                      IF (LONGCARD(msg1^.Class) = ISupID) THEN
  914.                        keepon1 := FALSE
  915.                      END;
  916.                      IReplyMsg(msg1)
  917.                    END
  918.                  END;
  919.                  IRemoveRequester(rl);
  920.                END
  921.              END
  922.         END (* case *)
  923.  
  924.       ELSIF (MenuPick IN msg2^.Class) THEN
  925.         WHILE (code # MenuNull) DO
  926.           count := MENUNUM(code);
  927.           IF (count = NoMenu) THEN count := 0 END;
  928.           count1 := ITEMNUM(code);
  929.           IF (count1 = NoItem) THEN count1 := 0 END;
  930.           count2 := SUBNUM(code);
  931.           IF (count2 = NoSub) THEN count2 := 0 END;
  932.           args[0].W := count;
  933.           args[1].W := count1;
  934.           args[2].W := count2;
  935.           count := sprintf(ADR(buffer),ADR(MessageText3),args);
  936.           IClearRenderWindow(ri,win,
  937.             MessageLeftEdge,
  938.             MessageTopEdge,
  939.             MessageLeftEdge+MessageWidth-1,
  940.             MessageTopEdge+MessageHeight-1,0);
  941.           count := IPrintText(ri,win,ADR(buffer),0,MessageTopEdge,
  942.             TextDataTypeText,TextDataFlagCenter+TextDataFlagColor2,
  943.             ADR(topaz80attr));
  944.           menuitem := IMenuItemAddress(ml,code);
  945.           code := menuitem^.NextSelect;
  946.         END
  947.       END;
  948.       IReplyMsg(msg2)
  949.     END
  950.   END
  951. END testaction;
  952.  
  953. VAR
  954.   gl,ml,ri:ADDRESS;
  955.   win:WindowPtr;
  956.   gd:GadgetPtr;
  957.   dummy:ADDRESS;
  958.  
  959. BEGIN
  960.   IntuiSupBase := OpenLibrary(ADR("intuisup.library"),3);
  961.   IF (IntuiSupBase # NIL) THEN
  962.     InitData();
  963.     IF (buildtestlist()) THEN
  964.       ri := IGetRenderInfo(NIL,RenderInfoFlags);
  965.       IF (ri # NIL) THEN
  966.         win := IOpenWindow(ri,testnewwindow,OpenWindowFlags);
  967.         IF (win # NIL) THEN
  968.           testgadgetdata[TestGadgetButtonImage].gdButtonData.gdButtonNormalRender := ADR(image1);
  969.           gl := ICreateGadgets(ri,ADR(testgadgetdata),0,0,NIL);
  970.           IF (gl # NIL) THEN
  971.             ml := ICreateMenu(ri,win,ADR(testmenudata),ADR(topaz60attr),NIL);
  972.             IF (ml # NIL) THEN
  973.               IDisplayGadgets(win,gl);
  974.               IAttachMenu(win,ml);
  975.               testaction(ri,win,gl,ml);
  976.               dummy := IRemoveMenu(ml);
  977.               dummy := IRemoveGadgets(gl);
  978.               IFreeMenu(ml)
  979.             ELSE
  980.             END;
  981.             IFreeGadgets(gl)
  982.           ELSE
  983.           END;
  984.           CloseWindow(win^);
  985.         ELSE
  986.         END;
  987.         IFreeRenderInfo(ri)
  988.       ELSE
  989.       END;
  990.       freetestlist()
  991.     ELSE
  992.     END;
  993.     FreeData();
  994.     CloseLibrary(IntuiSupBase^);
  995.     IntuiSupBase := NIL;
  996.   ELSE
  997.   END;
  998. END Test.
  999.  
  1000.